package com.ziyueyuwen.xiniao.dao;

import com.ziyueyuwen.xiniao.bean.query.QuestionQuery;
import com.ziyueyuwen.xiniao.bean.question.ZyQuestionData;
import com.ziyueyuwen.xiniao.bean.vo.ZyQuestionDataVO;
import com.ziyueyuwen.xiniao.enums.LessonModuleEnum;
import com.ziyueyuwen.xiniao.enums.QuestionTypeEnum;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * @author wancheng
 */
public interface ZyQuestionDataMapper {
    /**
     * 主键删除
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 保存
     * @param record
     * @return
     */
    int insertSelective(ZyQuestionData record);

    /**
     * 主键查询
     * @param id
     * @return
     */
    ZyQuestionData selectByPrimaryKey(Integer id);

    /**
     * 主键修改
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(ZyQuestionData record);

    /**
     * 返回知识点
     * @param questionDataId
     * @return
     */
    ZyQuestionDataVO getQuestionDataByQuestionId(Integer questionDataId);

    /**
     * 返回题的jsonobject questionData为null
     * @param courseId
     * @param lessonIndex
     * @param lessonQuestionType
     * @return
     */
    List<ZyQuestionDataVO> getQuestionDataOfCourseLesson(@Param("courseId") Integer courseId,
                                                         @Param("lessonIndex") Integer lessonIndex,
                                                         @Param("lessonQuestionType") LessonModuleEnum lessonQuestionType,
                                                         @Param("questionGroup") Integer questionGroup);

    /**
     * 分页查询
     * @param query
     * @return
     */
    List<ZyQuestionDataVO> getQuestionDataForPageQuery(QuestionQuery query);
}